/*
 * @Author: weisheng
 * @Date: 2023-04-17 12:51:22
 * @LastEditTime: 2023-04-20 15:01:53
 * @LastEditors: weisheng
 * @Description:
 * @FilePath: \uniapp-vue3-fant-ts\src\api\DemoApi.ts
 * 记得注释
 */
import http from '@/http/HttpClient'
import BaseResponse from '@/model/BaseResponse'
import Chanel from '@/model/Chanel'
import UserInfo from '@/model/UserInfo'
import { getParams } from '@/utils/common'
// 这里将API方法统一管理
export default class DemoApi {
  static login1(data): Promise<BaseResponse<UserInfo>> {
    return http
      .server()
      .post('/cityAdmin/mall/open/v2/login_check', data, {})
      .then((res) => {
        return res.data
      })
  }
  static getOrder(url,data): Promise<BaseResponse<Chanel[]>> {
    return http
      .server()
      .get(`/cityAdmin/mall/order/v2/${url}${getParams(data)}`, {})
      .then((res) => {
        return res.data
      })
  }
  // 订单详情
  static getOrderInfo(data): Promise<BaseResponse<Chanel[]>> {
    return http
      .server()
      .get(`/cityAdmin/mall/order/v2/info_page${getParams(data)}`, {})
      .then((res) => {
        return res.data
      })
  }
  // 修改价格
  static modifyPayprice(data): Promise<BaseResponse<UserInfo>> {
    return http
      .server()
      .post('/cityAdmin/mall/order/v2/modify_pay_price', data, {})
      .then((res) => {
        return res.data
      })
  }
  // 取消订单
  static cancelOrder(data): Promise<BaseResponse<UserInfo>> {
    return http
      .server()
      .post('/cityAdmin/mall/order/v2/cancel', data, {})
      .then((res) => {
        return res.data
      })
  }
  // 确定取货
  static setPickUP(data): Promise<BaseResponse<UserInfo>> {
    return http
      .server()
      .post('/cityAdmin/mall/order/pick_up', data, {})
      .then((res) => {
        return res.data
      })
  }
  // 确定还车
  static setLeaseOk(data): Promise<BaseResponse<UserInfo>> {
    return http
      .server()
      .post('/cityAdmin/mall/order/lease_ok', data, {})
      .then((res) => {
        return res.data
      })
  }
  // 其他
  static getCourierData(): Promise<BaseResponse<UserInfo>> {
    return http
      .server()
      .get(`/cityAdmin/mall/order/v2/courier_data`, {})
      .then((res) => {
        return res.data
      })
  } // 其他
  static getLogistics(data): Promise<BaseResponse<UserInfo>> {
    return http
      .server()
      .get(`/cityAdmin/mall/order/v2/logistics${getParams(data)}`, {})
      .then((res) => {
        return res.data
      })
  }
  // 售后订单
  static getAfterSaleOrder(data): Promise<BaseResponse<UserInfo>> {
    return http
      .server()
      .get(`/cityAdmin/mall/order/v2/after_sale_order${getParams(data)}`, {})
      .then((res) => {
        return res.data
      })
  }
  // 售后订单详情
  static getAfterSaleOrderInfo(data): Promise<BaseResponse<UserInfo>> {
    return http
      .server()
      .get(`/cityAdmin/mall/order/v2/after_sale_info${getParams(data)}`, {})
      .then((res) => {
        return res.data
      })
  }
  // 拒绝退款文案
  static getRefuseReason(data = {}): Promise<BaseResponse<UserInfo>> {
    return http
      .server()
      .get(`/cityAdmin/mall/order/v2/refuse_reason${getParams(data)}`, {})
      .then((res) => {
        return res.data
      })
  }
  // 拒绝退款
  static submitRefuseReason(data): Promise<BaseResponse<UserInfo>> {
    return http
      .server()
      .post('/cityAdmin/mall/order/v2/refund_operate', data, {})
      .then((res) => {
        return res.data
      })
  } 

}
